<!DOCTYPE html>
<html lang="en">

<head>
   <meta charset="UTF-8">
   <meta name="viewport" content="width=device-width, initial-scale=1.0">
   <title>Document</title>
</head>

<body>
   <script>
      var fullname = 'Hua';
      var obj = {
         fullname: 'Tai',
         prop: {
            fullname: 'Securities',
            getFullname: function () {
               return this.fullname;
            }
         }
      };

      console.log(obj.prop.getFullname());
      var test = obj.prop.getFullname;
      console.log(test());

      console.log(foo)
      console.log(bar)

      var foo = function () {
         // Some code
      };
      function bar() {
         // Some code
      }; 
   </script>
</body>

</html>